home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / gfx / misc / lise20.lha / lise2.0 / mdl / src / skeletton.doc < prev    next >
Text File  |  1993-03-31  |  4KB  |  97 lines

  1. What does skeletton.c do ?
  2. --------------------------
  3.  
  4. Skeletton.c is a modified version of mdl.c, which gives the
  5. C - programmer easy and convenient access to the menu
  6. routines. You can build your application menu in a very similar way
  7. as with mdl itself.
  8.  
  9.  
  10. Why another menu demo, there are so many others around...
  11. ---------------------------------------------------------
  12.  
  13. Most (in fact all that I have seen) Intuition demos initialize theier
  14. structures static, this means extensive and unreadable initialization is
  15. done, and most structures are NOT REENTRANT (This is especially worse for
  16. File Requesters !)
  17. So what programmers want is a procedural initialization and functional
  18. request or variable like readout of requesters and gadgets.
  19. So, here it comes.
  20.  
  21. Initialization:
  22. ---------------
  23.  
  24. You first have to write your call back routines, which are called
  25. when a menu point is selected, or a push button is pressed.
  26. Then you can add your functions to the intuition list at the main() routine
  27. using:
  28.  
  29.         add_item(x-pos, y-pos,TYPE,"text",opt1 , opt2);
  30.  
  31. Some items need a callback routine, some need a global variable to write to.
  32. These you can now add with:
  33.  
  34.         fn_command[fn_number] = (void *)CallbackRoutine;
  35.         var_value[fn_number] = &GlobalVariable;
  36.  
  37. Now you have to increment the fn_number.
  38. Available values for TYPE are:
  39.  
  40. Identifier      needs                comment
  41.  
  42. NEW_MENU        nothing              main point of menue, displayed in menu bar
  43. MENU            Callback             adds menu point under actual main point
  44. PUSH            Callback             adds a push button
  45. TOGGLE          Global variable      adds a toggle button
  46. SCALEX          Global variable      adds a scaler in x-direction
  47.                 opt1 = lowest value
  48.                 opt2 = highest value
  49. SCALEY          Global variable      adds a scaler in y-direction
  50. SELECTION       Global variable + Callback
  51.                                      adds a selector box with predefined items
  52. FILE_SELECT     Global variable + Callback
  53.                                      adds a file selector box
  54. STRING          Global variable + Callback
  55.                                      adds a string box
  56.  
  57. Function requesters:
  58. --------------------
  59.  
  60. You may, at any point of your programm, call a requester either for
  61. reading user input, or displaying a result. The following requesters
  62. are supported:
  63.  
  64.         Help(message_string);
  65.                 Displays the string in a special window.
  66.                 Take care, that the string has a LINEFEED
  67.                 before ending with 0 !
  68.  
  69.         StringBox("title_string",return_string);
  70.                 Asks the user to type in a string.
  71.  
  72.         FileSelect("title_string",return_string);
  73.                 Asks the user to choose a file.
  74.  
  75.  
  76. A few words about Aztec C:
  77. --------------------------
  78.  
  79. MDL as well as the skeletton are compiled under Aztec C version 5.0 !
  80. Aztec C complains about one ptr/ptr conversion (warning) (forget it).
  81. There is a real ugly Bug, which occures when you are declaring large
  82. arrays either global or local. May be, this is a 32K or 64K Problem.
  83. The only way around is, to declare pointers and do memory allocation
  84. with malloc by yourself !
  85.  
  86. Another stupidity is, that the standard C-Function system() is not
  87. implemented. You have to use "Execute" instead.
  88. (Even on the IBM PC the system command works correctly !)
  89.  
  90. And a last source of headace is the lack of the standard directory
  91. functions and the header file sys/stat.h and related utilities.
  92. WHY THE HELL DID NEITHER MANX NOR LATTICE SUPPORT THESE STANDARDS ?
  93. (again the IBM PC at least knows about these standards)
  94.  
  95. Such a nice Computer, but so lousy Software !
  96. Go on and try to change something !
  97.